﻿@using Microsoft.AspNetCore.Http
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>17商城</title>
<link type="text/css" href="~/css/css.css" rel="stylesheet" />
<link href="~/layui/css/layui.css" rel="stylesheet" />
<script type="text/javascript" src="~/js/jquery.js"></script>
<script type="text/javascript" src="~/js/js.js"></script>
</head>

<body class="layui-bg-black">
 
   <div style="width:400px;margin:100px auto ">
        <div class="layui-card" style=" color:black">
            <div class="layui-card-header layui-bg-green">管理员登录</div>
            <div class="layui-card-body">
                <form class="layui-form"  method="post" >
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名:</label>
                        <div class="layui-input-block">
                            <input type="text" name="LoginName" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-block">
                            <input type="password" name="LoginPwd" lay-verify="required" lay-reqtext="用户名是必填项，岂能为空？" placeholder="请输入密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="ayui-input-block" style="padding-top:35px;padding-left:110px">
                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="loginForm">登录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
<script src="~/layui/layui.js"></script>
 <script>
       layui.use(["form", 'layer'], function () {
            var form = layui.form;
            var $ = layui.$;
            var layer = layui.layer;
            //提交
            form.on('submit(loginForm)', function (data) {

                $.post("/flogin/index", data.field, function (res) {
                    if (res.isSuccess) {
                        layer.msg(res.msg, function () {
                            window.location.href = "/fhome/Index";
                        });
                    } else {
                        layer.msg(res.msg);
                    }
                });
                return false;
            });
        })
 </script>
</body>
</html>